{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>stu_myBook</title>
    <link rel="stylesheet" href="{% static 'css/sqlTable.css' %}">
    <link rel="stylesheet" href="{% static 'css/navbar.css' %}">
    <link rel="stylesheet" href="{% static 'css/pagination.css' %}">
    <link rel="stylesheet" href="{% static 'css/search.css' %}">
    <script type="text/javascript" src="{% static 'js/click.js' %}"></script>
</head>
<body>
<body background="{% static 'img/book.jpg' %}" style="background-repeat:no-repeat ;background-size:100% 100%;background-attachment: fixed;">
    {% load static %}
    <!-- 导航栏 -->
    <div class="navbar">
        <div class="system-name">图书馆图书借阅系统——已借图书</div>
        <nav class="menu">
            <a href="/stu_index" class="menu-item">系统首页</a>
            <a href="/stu_book" class="menu-item">借阅图书</a>
            <a href="/stu_borrow" class="menu-item">借阅记录</a>
            <a href="/stu_myBook" class="menu-item">已借图书</a>
            <a href="/stu_info" class="menu-item">个人中心</a>
        </nav>
        <div class="user-info">
            <img src="{{ stucc.avatar }}" class="user-avatar" alt="用户头像"/>
            <span class="username">欢迎您，同学：{{ stucc.stu_id }}</span>
            <a href="/login">
                <button class="button">退出</button>
            </a>
        </div>
    </div>
    <!-- 目录栏 -->
    <!-- 主内容区域 -->
    <div class= "container">
        <table>
            <thead>
                <tr>
                    <th>书籍号</th>
                    <th>借阅序号</th>
                    <th>借阅日期</th>
                    <th>应归还日期</th>
                    <th>归还日期</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {% for book_queryset in book_queryset %}
                <tr>
                    <td>{{ book_queryset.bookId_id }}</td>
                    <td>{{ book_queryset.borrow_id }}</td>
                    <td>{{ book_queryset.borrow_date }}</td>
                    <td>{{ book_queryset.due_date }}</td>
                    <td>{{ book_queryset.return_date }}</td>
                    <form method="post" action="">
                        {% csrf_token %}
                        <input type="hidden" name="form_id" value="return">
                        <input type="hidden" name="book_id" value="{{ book_queryset.bookId_id }}">
                        <input type="hidden" name="borrow_id" value="{{ book_queryset.borrow_id }}">
                        <td>
                            <button type="submit" value="归还" class="tablebutton">归还</button>
                        </td>
{#                        <a href="/stu_bookInfo">查看</a>#}
                    </form>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>

</body>

</html>